import React from "react";
import Square from './Square'

class Board extends React.Component {

    render() {
        const btnList = this.props.squares.map((item, index) =>
            <Square
                key={index}
                index={index}
                val={item}
                onIndex={this.props.onIndex}
                line={this.props.line}
            />)

        return (
            <div className={'board'}>
                { btnList }
            </div>
        )
    }
}

export default Board


